Intermediate iOS 15 Programming with Swift by Simon Ng

Intermediate iOS 15 Programming with Swift by Simon Ng

Author:Simon Ng
Language: eng
Format: epub, mobi
Publisher: GitBook


Figure 24.6. Tapping the snapshot now dismisses the menu

By applying custom view controller transitions properly, you can greatly improve the user experience and set your app apart from the crowd. The slide down menu is just an example, so try to create your own animation in your next app.

For reference, you can download the final project from http://www.appcoda.com/resources/swift55/SlideDownMenu.zip.

Chapter 25

Self Sizing Cells and Dynamic Type

In iOS 8, Apple introduced a new feature for UITableView known as Self Sizing Cells. To me, this was seriously one of the most exciting features for the SDK at the time. Prior to iOS 8, if you wanted to display dynamic content in a table view with variable heights, you would need to calculate the row height manually. In iOS 11, Apple's engineers take this feature even further. The self-sizing feature is enabled automatically. In other words, header views, footer views and cells use self-sizing by default for displaying dynamic content.

While this feature is now enabled without the need of configurations in iOS 14, I want you to understand what happens under the hood. In brief, here is what you need to do when using self sizing cells:

Define auto layout constraints for your prototype cell

Specify the estimatedRowHeight property of your table view

Set the rowHeight property of your table view to UITableView.automaticDimension



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.